from django.db import models


class Department(models.Model):
    name = models.CharField(max_length=20)
    class Meta:
        db_table='department'

class User(models.Model):
    username = models.CharField(max_length=20)
    password = models.CharField(max_length=80)
    authority = models.IntegerField()
    cate = models.ForeignKey(Department, on_delete=models.SET_NULL, null=True)

    class Meta:
        db_table = 'user'
